package com.atguigu.spzx.common.exception;

import com.atguigu.spzx.model.vo.common.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyGlobalExceptionHandler {

     @ExceptionHandler(Exception.class)
     public Result myExceptionHandler(Exception e){
          System.out.println("通用异常发生,打印异常信息");
          e.printStackTrace();
          return Result.fail(e.getMessage());
     }

}
